<template>
	<view class="passenger-flow">
		<view class=""
			style="width: 100%;height: 180rpx;background-color: #fff;position: relative;top: 0;z-index: 999;">
			<view class="con-1">
				<view class="bg">
					<view class="address">
						<view class="flex-space-between">
							<view class="flex-align">
								<van-image v-if="itemChooselist.venue_thumb != ''" width="74rpx" height="74rpx"
									radius="2" style="margin-right: 10rpx;" :src="itemChooselist.venue_thumb" />
								<van-image v-else width="74rpx" height="74rpx" radius="10rpx" fit="cover" style="margin-right: 10rpx;" src="https://img.yzcdn.cn/vant/cat.jpeg" />
								<view>
									<view class="address-name">{{itemChooselist.venue_name}}</view>
									<view class="address-desc">地址:{{itemChooselist.address}}</view>
								</view>
							</view>
							<view class="exchange flex-center flex-column " @click="show_no">
								<van-icon name="exchange" size="16" />
								切换
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="box_9">
			<view class="box_11">
				<view class="image-wrapper_7">
					<u-search @search="search" @custom="search" placeholder="搜索" :showAction="false"
						v-model="searchKey">
					</u-search>
				</view>
				<view class="label_list" @click="tianjiaclick">
					<image
						src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/0555f554c12d0d628b0e4e3e90147966755aa715.png"
						class="label_7"></image>
					<view class="label_77">
						添加
					</view>
				</view>
				<view class="label8_list" @click="dropdownclick">
					<image
						src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/a0caafa1d0f5c11490a41f203aab143debf439d6.png"
						class="label_8"></image>
					<view class="label_88">
						筛选
					</view>
				</view>
			</view>

			<view class="" style="margin-top: 100rpx;" v-if="type == ''">
				<u-sticky>
					<u-tabs :list="tabsList" lineColor="#FF4040" :activeStyle="{
									color: '#000000'
								}" :inactiveStyle="{
									color: '#353535'
								}" :lineWidth="30" :current="currentTab" @click="onClickTab" />
				</u-sticky>
			</view>

			<view class="" style="margin-top: 100rpx;" v-if="type == 1">
				<u-sticky>
					<u-tabs :list="tabsList_s" lineColor="#FF4040" :activeStyle="{
									color: '#000000'
								}" :inactiveStyle="{
									color: '#353535'
								}" :lineWidth="30" :current="current_Tab" />
				</u-sticky>
			</view>

			<!-- 潜客管理 -->
			<scroll-view scroll-y="true" style="width: 100%;height: 72vh;overflow: hidden;"v-if="currentTab == 0">
				<view class="section_5" v-for="(item,index) in 10" :key="index" @click="detailclick()">
					<!-- <view class="single-avatar_1">
						<image
							src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/45/9e19f395e62069d85a20ffe52d0192.jpg?attname=%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230425084656.jpg"
							mode=""></image>
					</view> -->
					<view class="group_5" @click="menberlist">
						<view class="box_1">
							<text lines="1" class="text_8">游泳2小时</text>
						</view>
						<text lines="1" class="text_10">12次</text>
						<text lines="1" class="text_10">No.123456789</text>
					</view>
					<view class="group_666" @click="menberlist1">
						<view class="group_6">
							<view style=" display: flex;flex-direction: column;position: absolute;right: 0;">
								悠然苑
								<!-- <image style="width: 25rpx; height: 25rpx;" src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/bb588778e244823de9dd4b707998cf41656e44f2.png" mode=""></image> -->
							</view>
							
							<view style="position: absolute;right: 0;top: 60rpx;">
								1564654656hh
							</view>
						</view>
						<view class="">
							<image style="width: 100rpx; height: 100rpx;border-radius: 50%;" src="https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/45/9e19f395e62069d85a20ffe52d0192.jpg?attname=%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230425084656.jpg" mode=""></image>
						</view>
					</view>
					

				</view>
			</scroll-view>
		</view>

		<!-- <v-gap /> -->
		<!-- 筛选 -->
		<view class="cons_contenter" v-if="dropdownmenu" @click="dropdownmenulist"></view>
		<view class="cons_con" v-if="dropdownmenu">
			<view class="cons_con_contenter" v-for="(item,index) in droplist" :key="index"
				@click='fieldclick(item,index)'>
				<view class="date-item_left">
					<view class="actives" v-if="dateActive === index">{{item.name}}</view>
					<view class="text-group_14-0" v-else>{{item.name}}</view>
				</view>
				<view class="date-item_right">
					<image v-if="dateActive === index" :src="item.img" class="image_19-0"></image>
				</view>
			</view>
		</view>
		<!-- 场馆切换 -->
		<van-popup closeable :show="show" round position="bottom" get-container="body" @close="showclose"
			:z-index='9999'>
			<view class="good-box">
				<view class="title">
					切换场馆
				</view>
				<view class="good-list">
					<view class="good-item" v-for="(item,index) in venuelist" :key="index" @click="onChangelist(item)">
						<view class="flex-align">
							<van-image width="124rpx" height="124rpx" radius="10rpx" fit="cover"
								v-if="item.venue_thumb != ''" :src="item.venue_thumb" />
							<van-image v-else width="124rpx" height="124rpx" radius="10rpx" fit="cover"
								src="https://img.yzcdn.cn/vant/cat.jpeg" />
							<view class="info">
								<view class="name">{{item.venue_name}}</view>
								<view class="flex-align" v-if="item.project_list != ''">
									<view class="tag" v-if="item.project_list[0].name != ''">
										{{item.project_list[0].name}}
									</view>
									<view class="tag" v-if="item.project_list[1].name != '' && item.project_list[1]">
										{{item.project_list[1].name}}
									</view>
									<view class="tag" v-if="item.project_list[2].name != ''&& item.project_list[2]">
										{{item.project_list[2].name}}
									</view>
								</view>
								<view class="address">{{item.address}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</van-popup>
	</view>
</template>

<script>
	const personal = require("@/api/personal/index.js");
	export default {
		data() {
			return {
				lineChartData: {},
				show: false,
				venuelist: [], //场馆列表
				itemChoose: {}, // 场馆数据
				itemChooselist: {}, // 场馆数据
				droplist: [{
					name: '价格由低到高',
					img: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/26d8a9fada06c95955c8ba81836aa4d8b927c35f.png',
				}, {
					name: '价格由高到低',
					img: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/26d8a9fada06c95955c8ba81836aa4d8b927c35f.png',
				}, {
					name: '销量排序',
					img: 'https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/img/26d8a9fada06c95955c8ba81836aa4d8b927c35f.png',
				}],
				dropdownmenu: false,
				dateActives: '',
				currentTab: 0,
				current_Tab: 0,
				tabsList: [{
						name: '计次卡'
					},
					{
						name: '时间卡'
					},
					{
						name: '充值卡'
					},
					{
						name: '私教卡'
					}
				],
				tabsList_s: [{
					name: '会员管理'
				}],
				studentlist: [{
						head_img: "https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/c7/2f68e33cb78b34dd21693863f714fb.jpg?attname=tmp_90a01b9bd3e863934b6a0a1cac82ba33.jpg",
						is_leave: 1,
						is_point: 1,
						mobile: "",
						name: "戴晓龙",
						id: 1
					},
					{
						head_img: "https://jiangsudiantuo2022.oss-cn-hangzhou.aliyuncs.com/c7/2f68e33cb78b34dd21693863f714fb.jpg?attname=tmp_90a01b9bd3e863934b6a0a1cac82ba33.jpg",
						is_leave: 1,
						is_point: 1,
						mobile: "",
						name: "李杰",
						id: 3
					}
				],
				selectList: [],
				isAllSelect: false, //是否全选
				bgMenuShow: false, //全局菜单弹窗
				selectItemId: -1,
				showMenu: true,
				type: ''
			}
		},
		onLoad(options) {
			this.type = options.type
			// 场馆数组
			if (uni.getStorageSync("entry_name") == '') {
				uni.showToast({
					title: '请登录！',
					icon: 'exception',
					duration: 850
				});
				setTimeout(() => {
					uni.navigateTo({
						url: '/pages/my-center/my-center'
					})
				}, 1000);
			}
			var data = uni.getStorageSync("wqzdy");
			var items = JSON.parse(data)
			this.venuelist = items
			this.itemChooselist = this.venuelist[0]
		},
		methods: {
			menberlist(){
				uni.navigateTo({
					url: '/member_card/service'
				})
			},
			menberlist1(){
				uni.navigateTo({
					url: '/member_profile/member_Details/member_Details'
				})
			},
			detailclick(){
				uni.navigateTo({
					url: './deteil'
				})
			},
		
			async analyse() {
				let params = {
					venue_id: this.itemChooselist.id,
					sourceTab: this.nac
				};
				let res = await personal.analyse(params);
				if (res.code == 1) {
					this.lineChartData = res.data.lineChartData
				}
			},
			// 蒙版关闭
			dropdownmenulist() {
				this.dropdownmenu = false
			},
			// 打开蒙版/选择
			dropdownclick() {
				this.dropdownmenu = true
			},
			onClickTab({
				index
			}) {
				this.currentTab = index;
				this.selectItemId = ''
			},
			// 分类点击
			fieldclick(item, index) {
				this.dateActive = index
				setTimeout(() => {
					this.dropdownmenu = false
				}, 200)
			},
			commoditylist(item, index) {
				uni.navigateTo({
					url: './commodity_product'
				})
			},
			// 分类点击
			fieldclicks(item, index) {
				this.dateActives = index
			},
			merchantclick(item, index) {
			},
			selectclick(item, index) {
			},
			// 选中场馆
			onChangelist(item) {
				this.itemChoose = item
				this.lineChartData = []
				this.itemChooselist = this.itemChoose
				this.show = false
			},
			// 点击切换
			show_no() {
				this.show = true
			},
			// 关闭选择场馆弹窗
			showclose() {
				this.show = false
			},
			// 跳转会员详情
			huiyuanxiangq() {
				uni.navigateTo({
					url: './member_Details/member_Details'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import '../../static/css/member/member_index.scss';
	
</style>